package com.lib.image.preview

import android.os.Parcelable
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import kotlinx.parcelize.Parcelize

class CoverViewModel: ViewModel() {

    private val coverSelection: MutableLiveData<CoverSelection> = MutableLiveData()

    fun getCoverSelection(): MutableLiveData<CoverSelection> {
        return coverSelection
    }


}

@Parcelize
data class CoverSelection(val pathArray: Array<String>, val index: Int): Parcelable {
    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (javaClass != other?.javaClass) return false

        other as CoverSelection

        if (!pathArray.contentEquals(other.pathArray)) return false
        if (index != other.index) return false

        return true
    }

    override fun hashCode(): Int {
        var result = pathArray.contentHashCode()
        result = 31 * result + index
        return result
    }
}